package com.maimao.kill.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.maimao.core.model.resp.PageResult;
import com.maimao.model.kill.KillApply;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2021/4/8 5:05 下午
 */
public interface KillApplyMapper extends BaseMapper<KillApply> {
    int updateBatch(@Param("list") List<KillApply> killApplyList);

    int updateCancel(@Param("id") Long id, @Param("cancel") int cancel);

    int insertBatch(@Param("list") List<KillApply> killApplyList);

    /**
     * 根据活动id和排期id查询审核通过或未审核的申请记录的params(sku信息)
     */
    List<String> selectNotFailParamsByAcIdAndSId(@Param("activityId") Integer activityId, @Param("scheduleId") Long scheduleId);

    List<KillApply> query(@Param("param") KillApply killApply);

    List<KillApply> selectByIdWithAcName(@Param("id") Long id);

    List<KillApply> selectByIdBatch(@Param("list") List<Long> idList);

    List<KillApply> selectDayLimitApplied(@Param("activityId") Integer activityId,
                                          @Param("goodsId") Long goodsId,
                                          @Param("fromTime") LocalDateTime fromTime,
                                          @Param("toTime") LocalDateTime toTime,
                                          @Param("status") Integer status);
}
